package com.suse.blog.model;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.suse.blog.utils.DataUtils;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;

import java.util.Date;

@Data
public class BlogInfo {
    private Integer id;
    @NotBlank(message = "标题不能为空")
    private String title;
    @NotBlank(message = "内容不能为空")
    private String content;
    private Integer userId;
    private Integer deleteFlag;

    //当前作者是否为当前用户
    private Boolean isLoginUser;

    private Date createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

//    public String getUpdateTime() {
//        return DataUtils.format(updateTime);
//    }
}
